<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix='c' uri="http://java.sun.com/jsp/jstl/core"%> 
<jsp:include page="/WEB-INF/view/body/customer/myPage_form.jsp"/>
<style type="text/css">
 	hr {border:#98211B 2px solid;}
  	.headline {margin-top: 0px; margin-bottom: 10px;}
  	.headtext {font-weight: bolder; color:#98211B; margin-top: 20px; margin-bottom: 0px;}
  	.sum {font-weight: bold;}
</style>	<br>
<script type="text/javascript">
function order(){
	var form=window.document.getElementById("form1");
	form.action="/${initParam.context_root}/order/orderForm.do";
	form.submit();
}
function del(){
	var form=window.document.getElementById("form1");
	form.action="/${initParam.context_root}/order/orderDel.do";
	form.submit();
}
</script>
<h1 class="headtext">장바구니</h1>
<hr class="headline">
<div style="float: center;">
	<table class="table table-bordered">
		<c:forEach items="${sessionScope.shop }" var="shopping">
		<tr>
			<td>
				<img width="200px"  height="210px" src="/${initParam.context_root }/product-img/${shopping.fileName }">
			</td>
			<td>
				<table class="table table-bordered">
					<tr>
						<td width="80px"><label>제품명</label></td>
						<td width="250px">${shopping.completeName }</td>
						<td width="80px"><label>가격</label></td>
						<td width="250px">${shopping.completePrice }</td>
						<td width="150px" colspan="2" align="right">
						<form id="form1" method="post">
								<input type="hidden" name="custId" value="${sessionScope.login_info.custId }">
								<input type="hidden" name="fileName" value="${shopping.fileName }">
								<input type="hidden" name="completeId" value="${shopping.completeId }">
								<input type="hidden" name="completeName" value="${shopping.completeName }">
								<input type="hidden" name="completePrice" value="${shopping.completePrice }">
								<input type="hidden" name="mainboardName" value="${shopping.mainboardName }">
								<input type="hidden" name="cpuName" value="${shopping.cpuName }">
								<input type="hidden" name="coolerName" value="${shopping.coolerName }">
								<input type="hidden" name="memoryName" value="${shopping.memoryName }">
								<input type="hidden" name="graphicName" value="${shopping.graphicName }">
								<input type="hidden" name="hddName" value="${shopping.hddName }">
								<input type="hidden" name="ssdName" value="${shopping.ssdName }">
								<input type="hidden" name="dvdName" value="${shopping.dvdName }">
								<input type="hidden" name="soundName" value="${shopping.soundName }">
								<input type="hidden" name="powerName" value="${shopping.powerName }">
								<input type="hidden" name="caseName" value="${shopping.caseName }">
								<input type="hidden" name="osName" value="${shopping.osName }">
								
								<input type="hidden" name="mainboardId" value="${sessionScope.completePCBasic.mainboardId }">
								<input type="hidden" name="cpuId" value="${sessionScope.completePCBasic.cpuId }">
								<input type="hidden" name="coolerId" value="${sessionScope.completePCBasic.coolerId }">
								<input type="hidden" name="memoryId" value="${sessionScope.completePCBasic.memoryId }">
								<input type="hidden" name="graphicId" value="${sessionScope.completePCBasic.graphicId }">
								<input type="hidden" name="hddId" value="${sessionScope.completePCBasic.hddId }">
								<input type="hidden" name="ssdId" value="${sessionScope.completePCBasic.ssdId }">
								<input type="hidden" name="dvdId" value="${sessionScope.completePCBasic.dvdId }">
								<input type="hidden" name="soundId" value="${sessionScope.completePCBasic.soundId }">
								<input type="hidden" name="powerId" value="${sessionScope.completePCBasic.powerId }">
								<input type="hidden" name="caseId" value="${sessionScope.completePCBasic.caseId }">
								<input type="hidden" name="osId" value="${sessionScope.completePCBasic.osId }">
							<input type="button" value="결제하기" class="btn btn-success" onclick="order()"> 
							<input type="button" value="삭제하기" class="btn btn-danger" onclick="del()">
							</form> 
						</td>
					</tr>
					<tr>
						<td><label>메인보드</label></td>
						<td>${shopping.mainboardName }</td>
						<td><label>CPU</label></td>
						<td>${shopping.cpuName }</td>
						<td><label>쿨러</label></td>
						<td>${shopping.coolerName }</td>	
					</tr>	
					<tr>	
						<td><label>메모리</label></td>
						<td>${shopping.memoryName }</td>
						<td><label>그래픽</label></td>
						<td>${shopping.graphicName }</td>
						<td><label>HDD</label></td>
						<td>${shopping.hddName }</td>
					</tr>	 
					<tr>
						<td><label>SDD</label></td>
						<td>${shopping.ssdName }</td>
						<td><label>DVD</label></td>
						<td>${shopping.dvdName }</td>
						<td><label>사운드</label></td>
						<td>${shopping.soundName }</td>
					</tr>
					<tr>
						<td><label>파워</label></td>
						<td>${shopping.powerName }</td>
						<td><label>케이스</label></td>
						<td>${shopping.caseName }</td>
						<td><label>운영체재</label></td>
						<td>${shopping.osName }</td>
					</tr>	
				</table>
			</td>
		</tr>
		</c:forEach> 
	</table>




